# 模拟移动端
import time

from selenium import webdriver

# 准备配置项
mobileEmulation = {'deviceName': 'iPhone X'}
# 创建选项对象
options = webdriver.ChromeOptions()
# 添加选项配置信息
options.add_experimental_option('mobileEmulation', mobileEmulation)
# 打开Chrome浏览器,配置选项对象
driver = webdriver.Chrome(options=options)
# 请求网址
driver.get('https://www.baidu.com')

time.sleep(5)
driver.quit()
